package com.yzh.IOCDI.V2;

public class Main {
    public static void main(String[] args) {
        //倒置依赖关系
//        在传统的代码中对象创建顺序是：Car -> Framework -> Bottom -> Tire
//        改进之后解耦的代码的对象创建顺序是：Tire -> Bottom -> Framework -> Car
        Tire tire = new Tire(11, "red");
        Bottom bottom = new Bottom(tire);
        FrameWork frameWork = new FrameWork(bottom);
        Car car = new Car(frameWork);
        //要这个就先构造好了传给你
        car.run();
    }
}
